/**
 * Copyright (C), 2020, Y2 T205
 * FileName: SearchController
 * Author: Lenovo
 * Date: 2020-05-22 15:23
 * Description:
 * History:
 * <author> <time> <version> <desc>
 * 作者姓名 修改时间 版本号 描述
 */


package com.atguigu.gulimall.search.controller;


import com.atguigu.gulimall.search.service.MallSearchService;
import com.atguigu.gulimall.search.vo.SearchParam;
import com.atguigu.gulimall.search.vo.SearchResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * 〈一句话功能简述〉<br>
 * 〈〉
 *
 * @author Lenovo
 * @create 2020-05-22
 * @since 1.0.0
 */
@Controller
public class SearchController {

    @Autowired
    MallSearchService mallSearchService;

    /*自动将页面提交过来的所有的请求查询参数封装成指定的对象*/
    @GetMapping("/list.html")
    public String listPage(SearchParam param, Model model)
    {
      SearchResult result= mallSearchService.search(param);
      model.addAttribute("result",result);
        return "list";

    }

}
